package scene;

import raytracer.Vector3f;

/// A class representing a camera viewing a scene.
public class Camera {
	public Camera() {
		halfangle = 35.0f;
		pos = new Vector3f(0, 0, -20);
		dir = new Vector3f(0, 0, -1);
		up = new Vector3f(0, 1, 0);
	}

	public Camera(float ha, float x, float y, float z, float dX, float dY, float dZ, float upX, float upY, float upZ) {
		halfangle = ha;
		pos = new Vector3f(x, y, z);
		dir = new Vector3f(dX, dY, dZ);
		up = new Vector3f(upX, upY, upZ);
		oriDir = new Vector3f();
		oriDir.copyFrom(dir);
	}

	@Override
	public String toString() {
		return "@" + pos + "  >" + dir + "  ^" + up + "   ha" + halfangle;
	}

	// / horizontal half angle
	public float halfangle;

	// / The 3D position of the camera.
	public Vector3f pos;

	// / cam direction
	public Vector3f dir;

	// / The up vector of the camera, the direction that will be pointed up on
	// the screen.
	public Vector3f up;

	public Vector3f oriDir;

}
